package io.mft.commons.function;

import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;

import io.mft.commons.function.response.kv.KVMap;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
@Getter
@Setter
@Builder
@Slf4j
public class ExecuteReturn extends KVMap{

	 
	        /**
	 * @说明：TODO
	 * @字段名称 serialVersionUID
	        */  
	    
	private static final long serialVersionUID = 9110082208185963509L;

	private int code=0;
	private String message="";
	private Future<?> asyncFuture;
	public void get(long timeout) {
		try {
			if (asyncFuture!=null) {
				if (timeout<0) {
					asyncFuture.get();
				}else {
					asyncFuture.get(timeout, TimeUnit.SECONDS);
				}
			}
		} catch (Exception e) {
			log.error("",e);
		}
	}
}
